package com.example.designmode.prototype;

//需要被克隆的类
public class Resume implements Cloneable{

    private User user;
    private String timeArea;
    private String company;

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public String getTimeArea() {
        return timeArea;
    }

    public void setTimeArea(String timeArea) {
        this.timeArea = timeArea;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    //实现Cloneable接口 重写clone方法实现 对象克隆效果
    @Override
    public Resume clone(){
        Resume resume = null;
        try {
            resume = (Resume) super.clone();
            return resume;
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
            System.out.println("克隆模式失败");
            return resume;
        }
    }
}
